<?php
require_once("includes/charges.tbl.php");
require_once("viewinfo.php");

$id = $_REQUEST["id"];
if($id > 0)
{
	$pClsCharges = new clsChargesTable($id);
	$title = $pClsCharges->value('title');
	$content = $pClsCharges->value('content');
	$attach = $pClsCharges->value('attach');
	$listcharges = $pClsCharges->listobj(10);
	$arr_link = array();
	foreach($listcharges as $pClsCharges)
	{
		if($pClsCharges->value('id') != $id)
		{
			$arr_link[$pClsCharges->value('title')] = "?page=charges&id=".$pClsCharges->value('id');
		}
	}
	view_info_with_attach($title, $content, $attach, "Các khoản thu khác", $arr_link );
}
else
{
	$title = "Các khoản thu";
	$pClsCharges = new clsChargesTable();
	$listcharges = $pClsCharges->listobj(10);
	view_list_charges($title, $listcharges);
}	
?>